Skip to content

build: deduplicate Objective-C runtime linkage - #220

Merged
Code-Hex merged 1 commit into
Code-Hex:mainfrom
steipete:codex/dedupe-objc-linker-flags
Sep 28, 2026
Merged

Code-Hex merged 1 commit into
Code-Hex:mainfrom
steipete:codex/dedupe-objc-linker-flags

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove redundant explicit -lobjc flags from Darwin cgo directives.
  • Keep all existing Foundation, Virtualization, and Cocoa framework links unchanged.
  • Rely on cgo/clang's Objective-C runtime linkage, which already contributes the required single runtime link.

This removes the Apple linker warning:

ld: warning: ignoring duplicate libraries: '-lobjc'

The warning was visible downstream because each Objective-C source file contributed another explicit -lobjc to the package link command.

Verification

  • go test -run '^$' . ./internal/objc (clean compile; warning absent)
  • go test -run '^$' ./...
  • go vet ./...
  • git diff --check

@Code-Hex Code-Hex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Code-Hex
Code-Hex merged commit b72f73d into Code-Hex:main Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants